package com.cgw.game.view;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;

import com.github.mikephil.charting.charts.HorizontalBarChart;

public class MyHorizontalBarChart extends HorizontalBarChart {
    public int pos = 0;
    public MyHorizontalBarChart(Context context) {
        super(context);
    }

    public MyHorizontalBarChart(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyHorizontalBarChart(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    @Override
    protected void init() {
        super.init();
        mRenderer = new MyHorizontalBarChartRenderer(this, mAnimator, mViewPortHandler);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if(mAxisRendererRight instanceof MyYAxisRenderer){
            ((MyYAxisRenderer) mAxisRendererRight).setDrawScale(true);
            ((MyYAxisRenderer) mAxisRendererRight).renderScaleLines(canvas);
        }
    }
}
